//
// POP ADMIN (plugin depracted and included into functions - 230705)
// It's better to be in the repo and reduce the number of plugins
// Nick Kind 230705
// Big up the Lestor Massif!
//
// HEADER TIDY
//
function pop_admin_header_tidy() {
// category feeds
// remove_action( 'wp_head', 'feed_links_extra', 3 );
// post and comment feeds
// remove_action( 'wp_head', 'feed_links', 2 );
// EditURI link
remove_action( 'wp_head', 'rsd_link' );
// windows live writer
remove_action( 'wp_head', 'wlwmanifest_link' );
// index link
remove_action( 'wp_head', 'index_rel_link' );
// previous link
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
// start link
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );
// links for adjacent posts
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
// WP version
remove_action( 'wp_head', 'wp_generator' );
}
//
// BETTER TITLE
//
function pop_admin_wp_title( $title ) {
// Do not filter for RSS feed / if SEO plugin installed
if ( is_feed() || class_exists('All_in_One_SEO_Pack') || class_exists('HeadSpace_Plugin') || class_exists('Platinum_SEO_Pack') || class_exists('wpSEO') || defined('WPSEO_VERSION') )
return $title;
if ( is_front_page() ) {
$title = get_bloginfo('name').' - '.get_bloginfo('description');
}
if ( is_front_page() && get_bloginfo('description') == '' ) {
$title = get_bloginfo('name');
}
if ( !is_front_page() ) {
$title .= ' - '.get_bloginfo('name');
}
return $title;
}
add_filter( 'wp_title', 'pop_admin_wp_title' );
//
// HIDES UPDATES FROM NON ADMINS
//
function ts_hide_update_notice_from_all_except_admin_users(){
if (!current_user_can('update_core')) {
remove_action( 'admin_notices', 'update_nag', 3 );
}
}
add_action( 'admin_head', 'ts_hide_update_notice_from_all_except_admin_users', 1 );
//
// CHANGE THE FOOTER
//
function pop_admin_footer() {
// echo '
';
echo 'Customisation by SDWM.';
}
add_filter( 'admin_footer_text', 'pop_admin_footer' );
//
// DASHBOARD WINDOW
//
add_action('wp_dashboard_setup', 'designed_by_thinksoda_dashboard');
function designed_by_thinksoda_dashboard() {
global $wp_meta_boxes;
wp_add_dashboard_widget('custom_help_widget', 'Designed and Integrated by SDWM', 'custom_dashboard_help');
}
function custom_dashboard_help() {
echo '
';
echo '
';
echo 'www.sdwm.com.au
';
echo 'Thanks for using SDWM,
';
echo 'for support or any enquiries please click here.
';
}
// CHANGES LOGO PATH FROM WORDPRESS
function pop_admin_login_url() {
return home_url();
}
// CHANGES LOGO ALT TEXT
function pop_admin_login_title() {
return get_option( 'blogname' );
}
//
// LOGIN SCREEN
//
function my_login_stylesheet() {
wp_enqueue_style( 'custom-login', get_stylesheet_directory_uri() . '/sass/login.css' );
}
add_action( 'login_enqueue_scripts', 'my_login_stylesheet' );
//
// ONLY CALL AT LOGIN PAGE - otherwise we load everything in admin
//
//add_action( 'login_enqueue_scripts', 'pop_admin_login_css', 10 );
add_filter( 'login_headerurl', 'pop_admin_login_url' );
add_filter( 'login_headertext', 'pop_admin_login_title' );
//
// REMOVE STUFF WE DONT NEED
//
// GUTTENBERG
//
add_action( 'wp_print_styles', 'wps_deregister_styles', 100 );
function wps_deregister_styles() {
wp_dequeue_style( 'wp-block-library' );
wp_dequeue_style( 'global-styles' );
}
//
// EMOJIES
//
function disable_wp_emojicons() {
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
// filter to remove TinyMCE emojis
// add_filter( 'tiny_mce_plugins', 'disable_emojicons_tinymce' );
}
add_action( 'init', 'disable_wp_emojicons' );
?>
//
// AJAX FUNCTION
//
/*
add_action( 'wp_ajax_ajax_function', 'ajax_function' );
add_action( 'wp_ajax_nopriv_ajax_function', 'ajax_function' );
function ajax_function() {
// GET VARS
$what_is_clicked = $_POST['send_what_is_clicked'];
wp_die();
}
*/
//
?>
//
// CPT - PROJECT
//
add_action( 'init', 'my_custom_post_project' );
function my_custom_post_project() {
$labels = array(
'name' => _x( 'Project', 'post type general name' ),
'singular_name' => _x( 'Project', 'post type singular name' ),
'add_new' => _x( 'Add New', 'Project' ),
'add_new_item' => __( 'Add New Project' ),
'edit_item' => __( 'Edit Project' ),
'new_item' => __( 'New Project' ),
'all_items' => __( 'All Projects' ),
'view_item' => __( 'View Projects' ),
'search_items' => __( 'Search Projects' ),
'not_found' => __( 'No Projects found' ),
'not_found_in_trash' => __( 'No Projects found in the Trash' ),
'parent_item_colon' => '',
'menu_name' => 'Projects'
);
$args = array(
'labels' => $labels,
'public' => true,
'hierarchical' => true,
'show_in_nav_menus' => true,
'supports' => array( 'title', 'author'),
'has_archive' => true
);
register_post_type( 'project', $args );
}
add_action( 'init', 'my_custom_post_project' );
//
// CPT - TEAM
//
add_action( 'init', 'my_custom_post_team');
function my_custom_post_team() {
$labels = array(
'name' => _x( 'Team member', 'post type general name' ),
'singular_name' => _x( 'Team member', 'post type singular name' ),
'add_new' => _x( 'Add New', 'Team member' ),
'add_new_item' => __( 'Add New Team member' ),
'edit_item' => __( 'Edit Team member' ),
'new_item' => __( 'New Team member' ),
'all_items' => __( 'All Team members' ),
'view_item' => __( 'View Team members' ),
'search_items' => __( 'Search Team members' ),
'not_found' => __( 'No Team members found' ),
'not_found_in_trash' => __( 'No Team members found in the Trash' ),
'parent_item_colon' => '',
'menu_name' => 'Team'
);
$args = array(
'labels' => $labels,
'public' => true,
'hierarchical' => true,
'show_in_nav_menus' => true,
'supports' => array( 'title', 'author'),
'has_archive' => true
);
register_post_type( 'team', $args );
}
add_action( 'init', 'my_custom_post_team' );
?>
the_field('html_page_title'); ?>
// CACHE
$css_time = 'TS'.filemtime(get_template_directory() . '/style.css');
$js_time = 'TS'.filemtime(get_template_directory() . '/js/custom_scripts.js');
?>
wp_head(); ?>
// HEADER THEME
$the_page_id = get_queried_object_id();
$post_type = get_post_type($the_page_id);
if($post_type=='post'){
$header_theme = 'header_white';
} else{
$header_theme = get_field('header_theme', $the_page_id);
}
?>
Sorry but there is nothing here!